<?php

class SiteController extends Controller
{

	public $layout='usercenter';
	
	public function actions()
	{
		return array(
			'page'=>array(
				'class'=>'CViewAction',
			),
		);
	}

	/**
	 * 首页
	 */
	public function actionIndex()
	{

		$this->pageTitle=Yii::app()->name; 
		$this->render('index');
	}

	/**
	 * 错误页
	 */
	public function actionError()
	{
	    if($error=Yii::app()->errorHandler->error)
	    {
	    	if(Yii::app()->request->isAjaxRequest)
	    		echo $error['message'];
	    	else
	        	$this->render('error', $error);
	    }
	}
	
	/**
	 * 关于我们
	 */
	public function actionAbout()
	{
		
		$this->render('about');
		
	}

	/**
	 * 联系我们
	 */
	public function actionContact()
	{
		
		$this->render('contact');
	}
	
	/**
	 * 用户协议
	 */
	public function actionAgreement()
	{
		
		$this->render('agreement');
		
	}
	
	/**
	 * 隐私声明
	 */
	public function actionPrivacy()
	{
		$this->render('privacy');
	}
	
	/**
	 * 登录跳转
	 */
	public function actionLogin()
	{
	
		$this->redirect($this->createUrl('user/login'));
	
	}

}